<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>sim.changeEntityColor</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simChangeEntityColor" id="simChangeEntityColor"></a>sim.changeEntityColor </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>
Changes the color of an <a href="../entities.htm">entity</a>, and returns its original color. Currently only takes into account <a href="../collections.htm">collections</a> and <a href="../shapes.htm">shapes</a>. See also <a href="simRestoreEntityColor.htm">sim.restoreEntityColor</a>. </td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>table[] originalColorData=sim.changeEntityColor(int entityHandle,table[3] newColor,int colorComponent=sim.colorcomponent_ambient_diffuse)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div><strong>entityHandle</strong>: the handle of a entity</div>
<div><strong>newColor</strong>: a table to 3 rgb values, each between 0-1</div>
<div><strong>colorComponent</strong>: a <a href="../apiConstants.htm#colorComponents">color component</a></div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div><strong>originalColorData</strong>: the original color data, to be used as argument with <a href="simRestoreEntityColor.htm">sim.restoreEntityColor</a></div>
</td> 
</tr> 
</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
